using com.lythen.file.Security.Entities;
using SQLite.CodeFirst;
using System.Data.Entity;

namespace com.lythen.file.Security.Configuration
{
    public class LythenContext : DbContext
    {
        public LythenContext()
            : base("name=SQLiteContext")
        {
            Configuration.LazyLoadingEnabled = true;
            Configuration.ProxyCreationEnabled = true;
        }
        public virtual DbSet<UserKeys> UserKeysSet { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            var sqliteConnectionInitializer = new SqliteCreateDatabaseIfNotExists<LythenContext>(modelBuilder);

            Database.SetInitializer(sqliteConnectionInitializer);
            base.OnModelCreating(modelBuilder);
        }
    }
}
